﻿@using System.Web.Optimization
@using VideoSeller.Business.Data.Enums
@model ContentListViewModel

@{
	ViewBag.Title = Html.GetGlobalResource("PagesTitles", "CabinetOnline");
	Layout = "~/Views/Shared/_DefaultLayout.cshtml";
    
   
}

@section HeadContent {
		@Styles.Render("~/Content/themes/base/onlinestyles")
		@Scripts.Render("~/videoseller/scripts/onlinescripts")
		<script src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js" type="text/javascript"></script>
}
 

<div class="tabs">
	@Html.Partial("~/Views/Shared/_CabinetTabs.cshtml", CabinetTabs.Online)
	<div class="tab_content">	
		<div class="tab_inner tab_inner_act">
            <div id = "action_block_small" class="action_block_small" 
				onclick='showhide("action_block_small","none"); showhide("action_block_full","block");'>@Html.GetGlobalResource("Common","ActionInfo")</div>
			<div id = "action_block_full" class="action_block_full" style="display:none;">@Html.RenderBlock("Action")
			<input class="action_link_using" type ="text" value="@String.Format("{0}account/register/{1}",Html.GetMainWebPath(),Model.CurrentUserId)" />
			<div class="accordeon_close_panel"><a href="javascript:void(0);" onclick='showhide("action_block_small","block"); showhide("action_block_full","none");'>@Html.GetGlobalResource("Common", "CloseButton")</a></div>
			</div>
            <a href="javascript:void(0);" onclick="chDisplay('testcamdiv');">@Html.GetLocalResource("TestCamera")</a>
            <div id="testcamdiv" style="display: none;">
            <div style="display: inline-block; margin-bottom: 30px; margin-top: 30px;">
			<div class="publish_container">
				<div class="play_msg" id="pub1_msg">Visell player</div>
				<div id="pub1_flashdiv" class="pub-player xy_640x480">
					<script type="text/jscript">
					    if (AC_FL_RunContent == 0) {
					        alert("This page requires AC_RunActiveContent.js.");
					    } else {
					    	addppublicator('pub1', 'rtmp://visell.tv/test', 'u=@Model.CurrentUserId&s=@Model.CurrentSessionId&i=0&tm=1&amp;');

					    }
					</script>
				</div>
				<div id="pub1_bott_panel" class="publish_bt_panel">

					<div id="pub1_publish" class="publish_btn" title="Publish video" style="display: none;" onclick=' publishCamera("pub1"); '></div>
					<div id="pub1_unpublish" class="publish_btn_off" title="Stop broadcasting" style="display: none;" onclick='unpublishCamera("pub1");'></div>

                    <div id="pub1_settings_btn" class="setup_btn" style="position:relative;" onclick="chDisplay('camPresets'); ">
                    <div id="camPresets" class="camPresetsBlock" style="display:none;">
                        <label>@Html.GetGlobalResource("Flash", "Presets"):</label>
                        @foreach (var camparam in Model.AllCamParams)
                        {
                            <a onclick="sendCamParam('pub1','@camparam.Value','camPresets'); return false;">@Html.GetGlobalResource("Flash", @camparam.KeyName)</a>
                        }
                    </div>
                        </div>
						<div id ='pub1_camera_param' class="cam_resolution_show"></div>
				</div>

			
				<div style="clear: both;"></div>

			</div>
			<div id="pub1_settings" style="display: none;">
				<div class="publish_container publish_props">
					<div class="cam-param">Camera mode: </div>
					<span class="cam-param">
						<label for="pub1_cwidth">Size: </label>
						<input id="pub1_cwidth" title="Horizontal resolution" class="cam-param-input" type="text" maxlength="4" value="1280" />
						<label for="pub1_cheight">x</label><input id="pub1_cheight" title="Vertical resolution" class="cam-param-input" type="text" maxlength="4" value="960" />
						<label for="pub1_cfps">Fps:</label><input id="pub1_cfps" title="Frames Per Second" class="cam-param-input" type="text" maxlength="2" value="15" />
					</span>
					<div style="clear: both;"></div>
					<div class="apply_btn" title="Apply camera mode" onclick="camera_applyMode('pub1');"></div>
					<div class="cam-param">
						<label for="pub1_fwa">Favor Area</label><input id="pub1_fwa" type="checkbox" checked="checked" />
					</div>
					<div style="clear: both;"></div>
				</div>
				<div class="publish_container publish_props">
					<div class="cam-param">Quality: </div>
					<span class="cam-param">
						<label for="">Bandwidth: </label>
						<input id="pub1_bw" title="Bandwidth. 0(auto) 1...16 " class="cam-param-input" type="text" maxlength="2" value="0" />
						<label for="pub1_fq">FrameQuality: </label>
						<input id="pub1_fq" title="Frame quality. 0(auto) 1(min quality, best performance) ... 100 (max quality)" class="cam-param-input" type="text" maxlength="3" value="80" />
					</span>
					<div style="clear: both;"></div>
					<div class="apply_btn" title="Apply quality" onclick="camera_applyQuality('pub1');"></div>
					<div class="cam-param">
						<label for="">KeyFrame:</label><input id="pub1_kfi" title="KeyFrame interval 1(best quality)...48(best performance)" class="cam-param-input" type="text" maxlength="2" value="15" />
					</div>
					<div style="clear: both;"></div>
				</div>
			</div>


		</div></div>
		<div style="clear: both;"></div>            <br/>

			<a href="javascript:void(0);" onclick="$('#add-online-content').dialog('open');">@Html.GetLocalResource("AddOnlineContent")</a>
			<br/>
            
			@Html.Partial("~/Views/Shared/_ContentList.cshtml", Model)
			<div id="add-online-content" title="@Html.GetLocalResource("AddOnlineContentPopupTitle")">
				<div id="wizard">
				</div>
			</div>
		</div>
	</div>
</div>
   @if (@Model.currentClient!=null && Model.currentClient.CountryId.HasValue)
    {
        <script type="text/javascript">function setdefcontent() { window.OnlineContent.SelectedCountry = '@Model.currentClient.CountryId'; window.OnlineContent.SelectedCulture='@Model.currentClient.Culture' }</script>
    }